<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <title>用户 - ${user.nickname!}</title>
        <meta name="keywords" content="${user.nickname!},主页"/>
        <meta name="description" content="${user.nickname!}的个人页面"/>
        <@tools.includePlace path="/common/8ddab9ba-a8aa-4745-86c6-66bf1c2c976c.html"/> <#-- header -->
    </head>
    <body>
        <@tools.includePlace path="/common/c32a4f4a-ff5d-49cf-bb59-5d9784539174.html"/> <#-- 导航 -->
        <div class="banner-l3 position-relative d-flex align-items-center justify-content-center" style="background:#22407c url(${site.sitePath}assets/img/banner-l3-bg-1.png) 50% 50% no-repeat;">
            <div class="container text-center position-relative py-3 py-md-4 text-white">
                <div class="breadcrumbs fs-7 text-white d-inline-flex align-items-center text-opacity-50">
                    <a href="${site.sitePath}">首页</a>
                    &gt; <a href="${site.dynamicPath}member/user.html?id=${user.id}" data-id="member">${user.nickname!}的个人页面</a>
                </div>
            </div>
        </div>
        <div class="container">
            <h1 class="mt-5" data-diy="user" data-diy-id="${user.id}"><a href="${site.dynamicPath}member/user.html?id=${user.id}">${user.nickname!}的个人页面</a><#if user.superuser>[管理员]</#if></h1>
            <div class="comment">
                <@cms.commentList contentId=contentId userId=user.id pageIndex=pageIndex pageSize=10>
                    <@import path="/ftl/tools.ftl" namespace="t"/><#-- 工具 -->
                    <#list page.list as a>
                        <@t.merge 'userIds' a.replyUserId!/>
                        <@t.merge 'contentIds' a.contentId!/>
                    </#list>
                    <@sys.user ids=t.userIds!><#assign userMap=map!/></@sys.user>
                    <@cms.content ids=t.contentIds!><#assign contentMap=map!/></@cms.content>
                    <#if page.totalCount gt 0>
                        <h3 class="mt-4">内容评论</h3>
                        <ul class="article-list">
                            <#list page.list as a>
                            <li class="card py-2 mb-2">
                                <p><a href="${contentMap[a.contentId?string].url}" target="_blank">${contentMap[a.contentId?string].title}</a><span class="float-end text-secondary">${a.createDate?string('yyyy-MM-dd hh:mm')}</span></p>
                                <#if a.replyId?has_content>
                                    <@cms.comment id=a.replyId>
                                        <p class="ms-5"><a href="${site.dynamicPath}member/user.html?id=${a.replyUserId!}" target="_blank">@${userMap[a.replyUserId?string].nickname}</a> : ${object.text!}</p>
                                    </@cms.comment>
                                </#if>
                                <p>${a.text!}</p>
                            </li>
                            </#list>
                        </ul>
                    </#if>
					<#assign url=site.dynamicPath+'user.html?id='+user.id/>
					<ul class="pagination mt-5 overflow-auto pb-3">
						<li class="page-item">
							<a class="page-link" href="${getPage(url,page.prePage,'pageIndex')}" aria-label="Previous">
								<span aria-hidden="true">«</span>
							</a>
						</li>
						<#assign start=1/>
						<#if (page.pageIndex-5) gt start>
						<#assign start=page.pageIndex-4/>
						</#if>
						<#assign end=page.totalPage/>
						<#if (page.pageIndex+5) lt end>
						<#assign end=page.pageIndex+4/>
						</#if>
						<#list start..end as a>
						<li class="page-item<#if a=page.pageIndex> active</#if>"><a class="page-link" href="${getPage(url,a,'pageIndex')}">${a}</a></li>
						</#list>
						<li class="page-item">
							<a class="page-link" href="${getPage(url,page.nextPage,'pageIndex')}" aria-label="Next">
								<span aria-hidden="true">»</span>
							</a>
						</li>
					</ul>
                </@cms.commentList>
            </div>
        </div>
		<script>
			var itemString="itemType=user&itemId=${user.id}";
			var templatePath='${.current_template_name?keep_after('/')}';
		</script>
		<@tools.includePlace path="/footer/7f8bacb5-30ca-4641-b66f-987d447b1a85.html"/> <#-- footer -->
    </body>
</html>
